<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <link rel="stylesheet" href="/semantic/dist/semantic.min.css">
  <script src="/node_modules/jquery/dist/jquery.min.js"></script>
  <!-- 注意：semantic.min.js 依赖于 Jquery -->
  <script src="/semantic/dist/semantic.min.js"></script>
  <script src="/node_modules/art-template/lib/template-web.js"></script>
  <link rel="stylesheet" href="./index.css">
  <script src="./index.js"></script>
</head>

<body>
  <h1>英雄列表</h1>

  <button class="ui primary button" id="add">添加英雄</button>

  <!-- 表格区域 -->
  <table class="ui celled striped blue table">
    <thead>
      <tr>
        <th>编号</th>
        <th>英雄名称</th>
        <th>性别</th>
        <th>创建时间</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody id="tbd">
    </tbody>
  </table>

  <!-- 对话框 -->
  <div class="ui tiny modal">
    <div class="header">
      添加新英雄
    </div>
    <div class="content">
      <form class="ui form">
        <div class="field">
          <label>名称：</label>
          <input type="text" name="name" placeholder="请输入英雄名称">
        </div>
        <div class="field">
          <label>性别：</label>
          <select name="gender" class="ui fluid dropdown">
            <option value="男">男</option>
            <option value="女">女</option>
          </select>
        </div>
      </form>
    </div>
    <div class="actions">
      <div class="ui black deny button">
        取消
      </div>
      <div class="ui positive right button" id="btnAdd">
        添加
      </div>
    </div>
  </div>

  <script type="text/template" id="row">
    {{each data}}
    <tr>
      <td>
        <div class="ui ribbon label {{$value.isdel === '000' ? 'blue' : 'red'}}">{{$value.isdel === '000' ? '正常' : '删除'}}</div>
        {{$value.id}}
      </td>
      <td>{{$value.name}}</td>
      <td>{{$value.gender}}</td>
      <td>{{$value.birthday}}</td>
      <td>
        <a href="javascript:;">编辑</a>
        <a href="javascript:;">删除</a>
      </td>
    </tr>
    {{/each}}
  </script>
</body>

</html>